package com.changgou.order.feign;

import com.changgou.entity.Result;
import com.changgou.order.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 订单feign接口
 */
@FeignClient(name = "order")
@RequestMapping("/order")
public interface OrderFeign {


    /***
     * 新增订单数据
     * @param order
     * @return
     */
    @PostMapping
    public Result add(@RequestBody Order order);

    /**
     * 根据用户名查询对应订单信息
     * @return
     */
    @RequestMapping("/list")
    List<Order> list();

    /***
     * 根据ID查询数据
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public Order findById(@PathVariable("id") String id);

    /***
     * 根据ID删除品牌数据
     * @param id
     * @return
     */
    @DeleteMapping(value = "/{id}" )
    public Result delete(@PathVariable("id") String id);

    /**
     * 获取所有未付款订单
     * @return
     */
    @RequestMapping("/waitPay")
    public List<Order> waitPay();

    /**
     * 待发货订单
     */
    @RequestMapping("/orderSend")
    public List<Order> orderSend();

    /**
     * 获取所有待收货订单
     * @return
     */
    @RequestMapping("/orderReceive")
    public List<Order> orderReceive();

    /**
     * 确认收货
     * @param orderId
     * @return
     */
    @RequestMapping("/orderConfirm")
    public Result orderConfirm(@RequestParam("orderId")String orderId);

    /**
     * 提醒发货
     * @param orderId
     * @return
     */
    @RequestMapping("/remindSend")
    public Result remindSend(@RequestParam("orderId")String orderId);
}
